<template>
	<view>
		<uni-section title="标题" sub-title="" type="square">
			{{data.title}}
		</uni-section>
		<uni-section title="内容" sub-title="" type="square">
			{{data.content}}
		</uni-section>
		<uni-section title="日期" sub-title="" type="square">
			{{data.date}}
		</uni-section>
		<uni-section title="姓名" sub-title="" type="square">
			{{data.name}}
		</uni-section>
		<uni-section title="评论" sub-title="" type="square">
			<navigator :url="'../comment/commentlist?foodid='+data.id" open-type="navigate"><button type="default">查看评论</button></navigator>
			<navigator url="../comment/addcomment" open-type="navigate"><button type="default">发表评论</button></navigator>
			
		</uni-section>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				"data": {
					"id": 2,
					"title": "学校的二楼的罗宋汤太棒了",
					"content": "酸、甜、辣、咸，就差一样苦，四味俱全！",
					"date": "2019-07-20",
					"name": "张三"
				},
			}
		},
		methods: {

		},
		onLoad(e) {
			let id = e.id
			uni.request({
				url: 'http://localhost:8090/freshmenapp/message/findone',
				method: 'POST',
				data: {
					id: id
				},
				success: res => {
					this.data = res.data.data
				},
				fail: () => {},
				complete: () => {}
			});
		}
	}
</script>

<style>

</style>